﻿@* Ui层项目 - 树形编辑组件文件 *@
@using Util.Generators.Helpers
@model Util.Generators.Contexts.EntityContext
@{
    var service = new GenerateService( Model );
    var description = $"{Model.Description}编辑页";
}
import { Component,ChangeDetectionStrategy, Injector } from '@@angular/core';
import { environment } from "@@env/environment";
import { TreeEditComponentBase } from "util-angular";
import { @service.GetClientQueryClassName() } from './model/@service.GetClientQueryFileName()';
import { @service.GetClientViewModelClassName() } from './model/@service.GetClientViewModelFileName()';

/**
 * @description
 */
@@Component( {
    selector: '@service.GetClientEntityFileName()-edit',
    changeDetection: ChangeDetectionStrategy.OnPush,
    templateUrl: environment.production ? './html/edit.component.html' : '@service.GetClientViewTemplateUrl()/edit'
} )
export class @service.GetClientEditClassName() extends TreeEditComponentBase<@service.GetClientViewModelClassName()> {
    /**
     * 下拉列表加载参数
     */
    queryParam: @service.GetClientQueryClassName();

    /**
     * 初始化@(description)
     * @@param injector 注入器
     */
    constructor( injector: Injector ) {
        super( injector );
    }

    /**
     * 初始化
     */
    ngOnInit() {
        super.ngOnInit();
        this.queryParam = this.createQuery();
    }

    /**
     * 创建下拉列表加载参数
     */
    protected createQuery() {
        let result = new @(service.GetClientQueryClassName())();
        return result;
    }

    /**
     * 创建模型
     */
    protected createModel() {
        let result = new @(service.GetClientViewModelClassName())();
        return result;
    }

    /**
     * 获取基地址
     */
    protected getBaseUrl() {
        return "@service.GetClientEntityName()";
    }
}